/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package onpu_dms_xls.kernel.common;

import onpu_dms_xls.exceptions.MyException;

/**
 *
 * @author snbm
 */
public enum VariableDataTypes {
    STRING ("String"),INT("int"),DOUBLE("double"),DATE("Date");

    private String value;

    private VariableDataTypes (String value){
        this.value = value;
    }

    public String getValue(){
        return this.value;
    }

    public VariableDataTypes getTypeFromName(String name) throws MyException{
        for (VariableDataTypes vd : VariableDataTypes.values()){
            if (vd.getValue().equals(name)){
                return vd;
            }
        }

        throw new MyException("VariableDataTypes", "getTypeFromName", "wrong name");
    }
};